User Profile Service Synchronization Service Stuck in "Stopping" State

Have a customer who's UPS Synchronization service is stuck in a "Stopping State"

The UPS service Application has been deleted.  A Stop-SPServiceInstance command has been run and the Get_SPServiceInstance command shows the service is "unprovisioning"

Any ideas on what can be done next to get the service in a stopped state?

October 23rd, 2010 8:05pm

Hi,

try an IISReset

Daniel Bugday

Free Windows Admin Tool Kit Click here and download it now
October 24th, 2010 9:35am

I've tried that.  I've also restarted the SharePoint box. 

It appears the chain of events was this:

1.  An attempt to delete the UPS Application was made.

2.  The deletion stayed in a stopping state.  Additionally the service stayed in a stopping state.

3.  Then, the Remove-SPServiceApplication was run. 

4.  The service application was removed but the sync service is still there, still in a "stopping" state.

 

I've attempted to run the Stop-SPServiceInstance command but that hasn't worked.  Now, I can't run that command more than once.  It throws an error stated that the service job instance already exists.....

I'm stuck at this point, having already restarted a multitude of services and the server itself.

October 24th, 2010 3:50pm

Something similar to Spencer Harbars Powershell for How to reset the Sync Machine Instance should help:

Add-PSSnapin Microsoft.SharePoint.Powershell 
# these will only work if there is one DB and one SA on the box. 
# If more than one, then use Get-SPDatabase and Get-SPServiceApplication 
# to grab the GUID and pass that in instead of the pipebind 
$syncDBType = "Microsoft.Office.Server.Administration.SynchronizationDatabase" 
$upaSAType = "User Profile Service Application" 
$syncDB = Get-SPDatabase | where-object {$_.Type -eq $syncDBType} 
$upa = Get-SPServiceApplication | where-object {$_.TypeName -eq $upaSAType} 
$syncDB.Unprovision() 
$syncDB.Status = "Offline" 
$upa.ResetSynchronizationMachine() 
$upa.ResetSynchronizationDatabase() 
$syncDB.Provision() 
# we MUST restart the timer service for the state to be reflected in 
# Services on Server and Manage UPA restart-service SPTimerV4 
# at this stage we MUST add the Farm account to the SyncDB (the above 
# steps remove the user) remember the default schema must be 'dbo'. 
# If we don't do this, UPS provisioning will fail. 

 Spence's article focuses on 'stuck on starting', but it does refer to a problem where the state is persisted after reboot, so this may help in the stuck on stopping case, too.

Free Windows Admin Tool Kit Click here and download it now
October 24th, 2010 8:00pm

Tom's suggestion is good and you should try that.

One other thing that you can try is checking the timer job for the service in Central Admin, maybe the deletion job got stuck there and you manually need to run it.

Daniel

October 24th, 2010 9:59pm

Daniel, which timer job is it?
Free Windows Admin Tool Kit Click here and download it now
October 26th, 2010 2:17pm

I wanted to use Harbar's scripts but the pickle I found myself in is that the UPS Application has already been deleted.  There is no Sync DB anymore because the associated databases were deleted with the service application.
October 26th, 2010 2:36pm

I ran the following commands:

1.  stsadm -o enumservices > c:\services.txt - Those gave me a list of services and showed me what the name of the service I need to stop is.

2.  stsadm -o provisionservice  -action stop -servicetype "Microsoft.Office.Server.Administration.ProfileSynchronizationService, Microsoft.Office.Server.UserProfiles, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" -servicename FIMSynchronizationService

The second command stopped the service. 

I'll create a new User Profile Service Application tonight or tomorrow and attempt to start this sync service again.  I'll update the post with a status afterwards.

  • Marked as answer by Stanfford Liu Thursday, November 04, 2010 3:06 AM
Free Windows Admin Tool Kit Click here and download it now
October 27th, 2010 7:33pm

Brilliant! this works great for the  FIMSynchronizationService, so at the least the user profile sync service is now stopped so that I can have a prayer of restarting. Only problem remains is that the user profile service is still in stopping state.

I tried applying the same logic to that, found the service, but it's servicename is blank. The command requires a servicename to function... any hints?

/Robin

November 3rd, 2010 5:06pm

just after posting this, I tried the command with nothing after -servicename and viola it worked!

 

  • Marked as answer by Stanfford Liu Thursday, November 04, 2010 3:06 AM
Free Windows Admin Tool Kit Click here and download it now
November 3rd, 2010 5:08pm

@Steamroller024 : The commands you mentioned helped me. My UPS was stuck at starting. So, I used Get-SPServiceInstance and then stop-spserviceinstance and that did the magic. I was able to stop the service successfully.

Thanks

Vishwas

May 16th, 2012 3:40pm

Thanks Steamroller024.  I've ran several commands to get it to stop, but the FIMSyncService was the one that kept the User Profile Synchronization service stuck at 'Starting...'

Free Windows Admin Tool Kit Click here and download it now
August 1st, 2012 8:00pm

This commands worked for me too
August 8th, 2012 8:28am

Thank you Robin4 & Streamroller04!  The method above also works for SharePoint 2013 services where the databases have been deleted.  I had the issue stuck on stopping for both Machine Translation Service and User Profile Service.  Leaving stsadm command line blank after -service was a great idea.  In my case Remove-SPServiceApplication with the -RemoveData option had already been run and the Service Applications no longer appeared under Manage Service Applications.

--John

Free Windows Admin Tool Kit Click here and download it now
August 15th, 2014 5:25pm

Restart the SharePoint Timer Service to resolve this isssue.
April 29th, 2015 1:59am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics